@using Lombiq.Hosting.Tenants.Maintenance.Constants
@using Lombiq.Hosting.Tenants.Maintenance.Controllers
@using OrchardCore.Mvc.Core.Utilities

<zone Name="Title"><h1>@RenderTitleSegments(T["Staggered Tenant Wake-up"])</h1></zone>
<div class="d-flex align-items-center gap-3 mb-3">
    <div class="form-check form-switch">
        <input class="form-check-input" type="checkbox" id="autoRefreshToggle">
        <label class="form-check-label" for="autoRefreshToggle">@T["Auto Refresh"]</label>
    </div>

    <div>
        <label for="refreshRateSelect" class="form-label mb-0">@T["Refresh Rate"]</label>
        <select class="form-select form-select-sm d-inline w-auto" id="refreshRateSelect">
            <option value="5000">@T["5s"]</option>
            <option value="10000" selected>@T["10s"]</option>
            <option value="15000">@T["15s"]</option>
            <option value="30000">@T["30s"]</option>
        </select>
    </div>
    <div id="refreshCountdown" class="text-muted small mt-1"></div>
</div>

<div id="maintenance-status-container"
     data-maintenance-url="@Url.Action(
         nameof(StaggeredTenantsWakeUpAdminController.GetPartialView),
         typeof(StaggeredTenantsWakeUpAdminController).ControllerName(),
         new { area = FeatureNames.Maintenance })">
    @await Html.PartialAsync("StaggeredTenantWakeUpDetails", (object)Model)
</div>

<style at="Head">
    #maintenance-progress-bar {
        transition: width 1s ease;
    }
</style>

<script asp-name="@ResourceNames.StaggeredTenantWakeUp" at="Foot"></script>
